<?php get_header('single');?>
<!-- Dung cho trang tin tuc va trang dich vu -->
<body>
<div id="container">
	<!-- baner -->
	<?php include TEMPLATEPATH.'/views/view-header.php';?>
	<!-- end banner-->
	<!-- menu -->
	<?php include TEMPLATEPATH.'/views/view-menu.php';?>
	<div class="body_content">
	<div id="content">
		
		<!-- left_comlumds -->
		<?php get_sidebar();?>
		<!--end left_comlumds -->
		<!-- right_comlumds -->
				<div class="right_comlumds">
			<!-- right_box_1 -->
			<div class="box_1_right">
				<div class="title_right">
					
					<div class="right_title_r3">
						<img alt="" src="<?php echo WP_MYSITE_TEMPLATE_URL;?>/images/icon_title.jpg">
						<a href="<?php echo WP_MYSITE_URL;?>" rel="nofollow">Home</a> » <strong class="current">Sản phẩm</strong>					
					</div>
					
				</div>
				<?php 
				the_post();
				$mypostid = get_the_ID();
				$title = get_the_title($mypostid);
				$thumbnail = db_get_post_meta($mypostid, $wpdb->prefix.'thumbnail');
				$alt = db_get_alt_attachment_id($mypostid, $wpdb->prefix.'thumbnail');
				if(!$alt)
					$alt = db_vietnamese_slug($title);
				$congtrinh = get_post_meta($mypostid,$wpdb->prefix.'cong-trinh',true);	
				?>
				<div class="content_about">
					<div class="box_chitiet">
						<h2><?php the_title();?></h2>
						<div class="thub_1">
							<a href="#" title="<?php echo $title;?>">
								
								<?php echo db_get_thumbnail($thumbnail,$alt,235,214);?>
							</a>
						</div>
						<div class="slide_thub">
							<h2><?php echo $congtrinh;?></h2>
							<?php 
							// Cong trinh thi cong 
							
							$photo_congtrinh = get_post_meta($mypostid, $wpdb->prefix.'thumbnail2',false);
							?>
							<div class="list_carousel">
								<ul id="foo2">
									<?php 
									if($photo_congtrinh)
									{
										foreach ($photo_congtrinh as $value) 
										{
											$mythumbnail = db_get_attached_file($value);
											$mytitle  = get_post_meta($mypostid,$wpdb->prefix.'title-fix-photo-'.$value,true);
										?>
										<li>
											<a href="<?php echo $mythumbnail;?>" class="lightbox-2" rel="flowers1" title="<?php echo $mytitle;?>">
											
											<?php 
											$title = "tieu de";
											echo db_get_thumbnail2($mythumbnail,$alt,$mytitle,201,163);?>
											</a>
										</li>
										<?php 										}
									}
									?>														
									
								</ul>
								<a id="prev2" class="prev" href="#"><img src="<?php echo WP_MYSITE_TEMPLATE_URL;?>/images/prev_slide.png" alt="" /></a>
								<a id="next2" class="next" href="#"><img src="<?php echo WP_MYSITE_TEMPLATE_URL;?>/images/next_slide.png" alt="" /></a>
								<div id="pager2" class="pager"></div>
							</div>
						</div>
						<!-- tab-->
											<!-- box_tab-->
								<!--tab-->
										<div class="tab_comment">
									<!-- box_1-->
										<ul class="tab">
											<li class="active">
												<div class="menu_tab_l"></div>
												<div class="menu_tab_m"><a href="#" id="a1">Mô tả</a></div>
												<div class="menu_tab_r"></div>
											</li>
												
											<li>
												<div class="menu_tab_l"></div>
												<div class="menu_tab_m"><a href="#" id="a2">Thông số kỹ thuật</a></div>
												<div class="menu_tab_r"></div>
											</li>
											<li>
												<div class="menu_tab_l"></div>
												<div class="menu_tab_m"><a href="#" id="a3">Cách sử dụng</a></div>
												<div class="menu_tab_r"></div>
											</li>
											
										</ul>
										 <div class="content_tab_nd" style="width:100%;">
											<div class="nd_1 active" id="c0" style="width:97.5%;">
												<div class="content_about_tab">
												   <?php the_content();?>
												</div>
												<div class="height_box"></div>
											</div>
											
											<div class="nd_1" id="c1" style="display:none">
												<div class="content_about2">
													<?php 
													//thong so ky thuat
													echo get_post_meta($mypostid,$wpdb->prefix.'thong-so-ky-thuat',true);
													?>			
												</div>
												<div class="height_box"></div>
											</div>
											<div class="nd_1" id="c2" style="display:none">
												<div class="content_about2">
													<?php 
													//thong so hướng dẫn sử dụng
													echo get_post_meta($mypostid,$wpdb->prefix.'cach-su-dung',true);
													?>

												</div>
												<div class="height_box"></div>
											</div>
											
										</div>
										
								<!-- end box_1 -->
								</div>
								<!--end tab-->
								<!-- end box_tab -->
						<!-- end Tab-->
						<div class="sanphamkhac">
							<h2>Sản phẩm tương tự</h2>
							<div class="sanphamtuongtu">
								<?php 
								$sanphamtuongtu = db_list_different_post_type($mypostid, 8, 'post', 'date', 'DESC', $wpdb->prefix.'display', 'display');
								query_posts($sanphamtuongtu);
								include TEMPLATEPATH.'/views/loop-sp.php';
								?>
							
							</div>
							
						</div>
					</div>
				</div>
			</div>
			<!-- end right_box_1 -->
			
		</div>
		<!-- right_comlumds -->
	</div>
	<!-- end content-->
</div>
	<!-- end content-->
	<?php get_footer('single');?>
